package com.banggood.pss.mqtools.bean;

/**
 * @author Mr.chen
 * @date 2020/8/19 9:25
 */
public class HasResultJsonMessageReceiver extends JsonMessageReceiver {

    String resultQueueName;

    /**
     * 自己调用发送信息
     */
    protected final JsonMessageSender jsonMessageSender;

    public HasResultJsonMessageReceiver(String queueName) {
        super(queueName);
        //尽力避免出现重复名字的队列
        resultQueueName = queueName + "-$result";
        jsonMessageSender = new JsonMessageSender(resultQueueName);
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        super.afterPropertiesSet();
        jsonMessageSender.channelCreator = this.channelCreator;
        jsonMessageSender.afterPropertiesSet();
    }

}
